package chapter06

object Test07_Inherit {

  def main(args: Array[String]): Unit = {

  }
}


// 定义一个父类
class Person {
  var id: Long = _
  var name: String = _

  // 辅助构造器
  def this(name: String, id: Long) {
    this
    this.id = id
    this.name = name
  }
}
// 无参继承
class Son extends Person {

}


// 有参继承
class Person1(var id: Long, var name: String) {

}

class Son1(id: Long, name: String) extends Person1(id: Long, name: String) {

}
